<?php
$params = array_merge(
    require __DIR__ . '/../../common/config/params.php',
    require __DIR__ . '/../../common/config/params-local.php',
    require __DIR__ . '/params.php',
    require __DIR__ . '/params-local.php'
);

return [
    'id' => 'app-frontend',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'frontend\controllers',
    'modules' => [
        'admin' => [
            'class' => 'frontend\modules\admin\adminModule',
            //'class' => 'mdm\admin\Module',
        ],
        'common' => [
            'class' => 'frontend\modules\common\CommonModule',
        ],
        'resource' => [
            'class' => 'frontend\modules\resource\ResourceModule',
        ],
        'general' => [
            'class' => 'frontend\modules\general\generalModule',
        ],
    ],
    'components' => [
        //皮肤
        'assetManager' => [
            'bundles' => [
                'dmstr\web\AdminLteAsset' => [],

            ],
        ],
        'authManager' => [
            'class' => 'yii\rbac\DbManager', // 使用数据库管理配置文件
        ],
        'request' => [
            'csrfParam' => '_csrf-frontend',
        ],
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
            'identityCookie' => ['name' => '_identity-frontend', 'httpOnly' => true],
        ],
        'session' => [
            // this is the name of the session cookie used for login on the frontend
            'name' => 'advanced-frontend',
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
            //'class' => 'frontend\modules\common\component\ErrorHandler',
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
            ],
        ],
    ],
    'as access' => [
        'class' => 'frontend\modules\admin\components\AccessControl',
        'allowActions' => [
                'site/*',//允许访问的节点，可自行添加
                'admin/*',//允许所有人访问admin节点及其子节点
        ]
    ],
    'params' => $params,
];
